<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>用户收徒报表管理管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function () {

        });
        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
        //清除缓存
        function clearCache(userId) {
            //服务预约列表信息
            url = "${ctx}/sys/user/clearCache/id/" + userId;
            $.ajax({
                type: "get",
                url: url,
                dataType: 'json',
                // data: parameter,
                success: function (data, textStatus) {
                    alert("同步成功");
                },
                complete: function (XMLHttpRequest, textStatus) {
                },
                error: function () {
                }
            });
        }
        ;
    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="${ctx}/userreport/userReport/">用户收徒报表管理列表</a></li>
    <shiro:hasPermission name="userreport:userReport:edit">
        <li><a href="${ctx}/userreport/userReport/form">用户收徒报表管理添加</a></li>
    </shiro:hasPermission>
</ul>
<form:form id="searchForm" modelAttribute="userReport" action="${ctx}/userreport/userReport/"
           method="post"
           class="breadcrumb form-search">
    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
    <ul class="ul-form">
        <li><label>账户名称：</label>
            <form:input path="account" htmlEscape="false" maxlength="64" class="input-medium"/>
        </li>
        <li><label>用户名称：</label>
            <form:input path="name" htmlEscape="false" maxlength="64" class="input-medium"/>
        </li>
            <%--<li><label>更新人：</label>--%>
            <%--<form:input path="updateBy.id" htmlEscape="false" maxlength="20" class="input-medium"/>--%>
            <%--</li>--%>
        <li><label>排序规则：</label>
            <select name="orderBy" class="input-medium">
                <option value="b.num" ${page.orderBy == 'b.num'?'selected="selected"':''}>徒弟数量排序
                </option>
                <option value="a.update_date" ${page.orderBy == 'a.update_date'?'selected="selected"':''}>
                    根据日期排序
                </option>
            </select>
                <%--<input name="updateDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
                           value="<fmt:formatDate value="${userReport.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                           onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>--%>
        </li>
            <%--<li><label>邀请人：</label>
                <form:input path="invitorId" htmlEscape="false" maxlength="20" class="input-medium"/>
            </li>--%>
        <li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
        </li>
        <li class="clearfix"></li>
    </ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <th>账户名称</th>
        <th>用户名称</th>
        <th>更新时间</th>
        <th>徒弟数量</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${page.list}" var="userReport">
        <tr>
            <td><%--<a href="${ctx}/userreport/userReport/form?id=${userReport.id}">--%>
                    ${userReport.account}
                    <%--</a>--%></td>
            <td>
                    ${userReport.name}
            </td>
            <td>
                <fmt:formatDate value="${userReport.updateDate}" pattern="yyyy-MM-dd"/>
            </td>
            <td>
                    ${userReport.num}
            </td>
            <td>
                    <%--<a href="${ctx}/userreport/userReport/form?id=${userReport.id}">修改</a>--%>
                <a href="${ctx}/userreport/userReport/delete?id=${userReport.id}"
                   onclick="return confirmx('确认要删除该用户收徒报表管理吗？', this.href)">删除</a>
                <a href="#" onclick="clearCache(${userReport.id})">清空缓存</a>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>